﻿<script id="simpleListItemsTemplate" type="text/template">
    <div ng-show="showController">
        @Html.Partial("Item/_SimpleFilter")
        @Html.Partial("Item/_SimpleEdit")
        <table class="table table-hover table-condensed">
            <tbody>
                <tr ng-repeat="item in list" ng-click="select($index)" ng-mouseenter="activate($index)" ng-mouseleave="deactivate($index)">
                    <td ng-bind-html="item.Message | linky:'_blank' " class="col-xs-10" ng-hide="item.editing" ng-dblclick="edit($index)"></td>
                    <td class="col-xs-10 editable-cell" ng-show="item.editing" ng-class="{'has-error' : !isValidItem(item)}">                                                
                            <input type="text" class="form-control" ng-bind="item.Message" ng-model="item.Message" ng-enter="save($index)" required ng-maxlength="250" />
                    </td>
                    <td class="col-xs-2 text-right">
                        <button class="btn btn-default" style="visibility:hidden">&nbsp;</button>
                        <span ng-show="$index==activeIndex">
                            <button ng-click="edit($index)" class="btn btn-default" title="Edit" ><span class="glyphicon glyphicon-edit"></span></button>
                            <button ng-click="remove($index)" class="btn btn-default" title="Delete" ><span class="glyphicon glyphicon-remove"></span></button>
                        </span>
                    </td>
                </tr>
            </tbody>
        </table>
        <div class="text-center">
            <button class="btn btn-default btn-text" ng-click="loadNextPage()" ng-show="showPager">Load More</button>
        </div>
    </div>
</script>
